import fs from 'fs'
var g_map_data_typename = {};
g_map_data_typename["A"] = ["墙壁", "平地1", "平地2", "戈壁", "山地", "海", "草地", "森林", "沙漠", "建筑物", "回复站", "基地1", "基地2", "基地3", "基地4", "基地5"];
g_map_data_typename["B"] = ["墙壁", "平地1", "平地2", "戈壁", "山地", "海", "草地", "森林", "沙漠", "建筑物", "回复站", "基地1", "基地2", "基地3", "基地4", "基地5"];
g_map_data_typename["C"] = ["墙壁", "地板1", "平地2", "裂地板", "地板3", "海", "草地", "森林", "墙壁2", "墙壁3", "回复站", "墙壁1", "基地2", "基地3", "基地4", "基地5"];
g_map_data_typename["D"] = ["墙壁", "平地1", "平地2", "戈壁", "山地", "海", "草地", "森林", "沙漠", "建筑物", "回复站", "墙壁1", "基地2", "基地3", "基地4", "基地5"];
var g_map_data_moveConsumeTable = {};
g_map_data_moveConsumeTable["A"] = [
    [9999, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], // 空
    [9999, 1, 1, 2, 3, 3, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1],
    [9999, 2, 2, 3, 4, 1, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2],
];
g_map_data_moveConsumeTable["B"] = [
    [9999, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    [9999, 1, 1, 2, 3, 3, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1],
    [9999, 2, 2, 3, 4, 1, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2],
];
g_map_data_moveConsumeTable["C"] = [
    [9999, 1, 1, 1, 1, 1, 1, 1, 999, 999, 1, 999, 1, 1, 1, 1],
    [9999, 1, 1, 2, 1, 3, 1, 2, 999, 999, 1, 999, 1, 1, 1, 1],
    [9999, 2, 2, 3, 1, 1, 3, 3, 999, 999, 2, 999, 2, 2, 2, 2],
];
g_map_data_moveConsumeTable["D"] = [
    [9999, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 999, 1, 1, 1, 1],
    [9999, 1, 1, 2, 3, 3, 1, 2, 2, 1, 1, 999, 1, 1, 1, 1],
    [9999, 2, 2, 3, 4, 1, 3, 3, 3, 2, 2, 999, 2, 2, 2, 2],
];

const baseRoot = '/assets/images/maprect/'
const mapDatas = []
let id = 0
// for(let i = 0; i < 16; i++){

Object.keys(g_map_data_typename).forEach(key => [
    g_map_data_typename[key].forEach((name, index) => {
        let data = {}
        data.id = ++id
        data.name = name
        data.src = `${baseRoot}${key}_0${index.toString(16).toUpperCase()}.png`
        data.air = g_map_data_moveConsumeTable[key][0][index]
        data.land = g_map_data_moveConsumeTable[key][1][index]
        data.ocean = g_map_data_moveConsumeTable[key][2][index]
        mapDatas.push(data)
    })
])
// }
// console.log(mapDatas.length)

fs.writeFile('./data/mapItems.json',JSON.stringify(mapDatas),'utf-8',err=>{})

